<extend name="Public/publicHTML" />

<block name="content">
<link rel="stylesheet" href="__COMMON__/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet"
	href="__COMMON__/bootstrap/css/font-awesome.min.css" />

<section class="content">
	<div class="row">
		<div class="col-xs-12">
			<div class="box">
				<nav class="navbar navbar-default"></nav>

				<!--新订单列表 基本信息-->
				<div class="panel panel-default">
					<div class="panel-heading">
						<h3 class="panel-title text-center">基本信息</h3>
					</div>
					<div class="panel-body">
						<table class="table table-bordered">
							<tbody>
								<tr>
									<td>订单 ID:</td>
									<td>订单号:</td>
									<td>会员:</td>
									<td>E-Mail:</td>
									<td>电话:</td>
									<td>应付:</td>
									<td>订单 状态:</td>
									<td>下单时间:</td>
									<td>支付时间:</td>
									<td>支付方式:</td>
								</tr>
								<tr>
									<td>{$order[$orderModel::$id_d]}</td>
									<td>{$order[$orderModel::$orderSn_id_d]}</td>
									<td><a href="#" target="_blank">{$order[$userModel::$userName_d]}</a></td>
									<td><a href="#">{$order[$userModel::$email_d]}</a></td>
									<td>{$order[$userModel::$mobile_d]}</td>
									<td>{$order[$orderModel::$priceSum_d]}</td>
									<td id="order-status">{$orderStatus[$order[$orderModel::$orderStatus_d]]}

                                    </td>
									<td>{$order[$orderModel::$createTime_d]|date='Y-m-d
										H:i',###}</td>
									<td>
                                        <if condition="$order[$orderModel::$orderStatus_d]  gt 0">
                                            {$order[$orderModel::$payTime_d]|date='Y-m-d H:i',###}
                                        <else />
                                            N
                                        </if>
                                    </td>

									<td id="pay-type">{$order[$orderModel::$payType_d]|default='微信支付'}</td>
								</tr>
                                <tr>
                                    <td colspan="2">用户订单备注信息</td>
                                    <td colspan="8">{$order['remarks']} </td>
                                </tr>

							</tbody>
						</table>
					</div>
				</div>
				<!--新订单列表 收货人信息-->
				<div class="panel panel-default">
					<div class="panel-heading">
						<h3 class="panel-title text-center">收货信息</h3>
					</div>
					<div class="panel-body">
						<table class="table table-bordered">
							<tbody>
								<tr>
									<td>收货人:</td>
									<td>联系方式:</td>
									<td>地址:</td>
									<td>邮编:</td>
									<td>配送方式:</td>
								</tr>
								<tr>
									<td>{$receive[$userAddressModel::$realname_d]}</td>
									<td>{$receive[$userAddressModel::$mobile_d]}</td>
									<td>{$receive[$userAddressModel::$provId_d]}、{$receive[$userAddressModel::$city_d]}、{$receive[$userAddressModel::$dist_d]}、{$receive[$userAddressModel::$address_d]}</td>
									<td><if condition="$receive.zipcode neq ''">
										{$receive.zipcode} <else /> N </if></td>
									<td>{$order[$orderModel::$expId_d]}</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<!--新订单列表 商品信息-->
				<div class="panel panel-default">
					<div class="panel-heading">
						<h3 class="panel-title text-center">商品信息</h3>
					</div>
					<div class="panel-body">
						<table class="table table-bordered">
							<thead>
								<tr>
									<td class="text-left">商品</td>
									<td class="text-right">数量</td>
									<td class="text-right">单品价格</td>
									<td class="text-right">会员折扣价格</td>
									<td class="text-right">单品小计</td>
								</tr>
							</thead>
							<tbody>
								<volist name="goods" id="good">
								<tr>
									<td class="text-left"><a
										href="{:C('front_url')}/Home/Goods/goodsDetails/id/{$good['goods_id']}.html"
										target="_blank"> {$good[$goodsModel::$title_d]}</a></td>
									<td class="text-right">{$good[$orderGoodsModel::$goodsNum_d]}</td>
									<td class="text-right">{$good[$orderGoodsModel::$goodsPrice_d]}</td>
									<td class="text-right">{:sprintf('%01.2f',$good[$orderGoodsModel::$goodsPrice_d]*$order[$userModel::$memberDiscount_d]/100)}</td>
									<td class="text-right">{$good[$orderGoodsModel::$goodsNum_d]
										* $good[$orderGoodsModel::$goodsPrice_d]}</td>
								</tr>
								<php>$price += $good[$orderGoodsModel::$goodsNum_d] *
								$good[$orderGoodsModel::$goodsPrice_d];</php> </volist>

								<tr>
									<td colspan="3" class="text-right">小计:</td>
									<td class="text-right">{$price}</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>

				<!--新订单列表 费用信息-->
				<div class="panel panel-default" id="moneryInformation">
					
				</div>

				<!--新订单列表 操作信息-->
				<div class="panel panel-default">
					<div class="panel-heading">
						<h3 class="panel-title text-center">操作信息</h3>
					</div>
					<div class="panel-body">
						<table class="table table-bordered">
							<tbody>
								<tr>
									<div class="row">
										<td class="text-right col-sm-2"><p class="margin">当前可执行操作：</p></td>
										<td colspan="3">
											<div class="input-group">
												<switch name="order['order_status']">
                                                    <case value="-1">
                                                        <button class="btn btn-primary margin"
                                                                onclick="Sender.setOrderStatus({$order.id},-2,'{:U('setOrderStatus')}')"
                                                                type="button" id="confirm">删除订单</button>

                                                    </case>
                                                    <case value="0">
                                                        <button class="btn btn-primary margin"
                                                                onclick="Sender.setOrderStatus({$order.id},-1,'{:U('setOrderStatus')}')"
                                                                type="button" id="confirm">取消订单</button>

                                                    </case>
                                                    <case value="1">
                                                        <a class="btn btn-primary margin" href="{:U('sendGoods',array('order_id'=>$order['id']))}">发货</a>
												    </case>
                                                    <case value="5">
                                                        <button class="btn btn-primary margin"
                                                            onclick="Sender.returnGoods({$order.id},'{:U('ReturnOrder')}')"
                                                            type="button" id="confirm">退货</button>

                                                        <button class="btn btn-primary margin"
                                                            onclick="Sender.noReturn({$order.id},'{:U('noReturn')}')"
                                                            type="button" id="confirm">不予退货</button>
                                                    </case>
                                                    <case value="7">

												<button class="btn btn-primary margin"
													onclick="Sender.alertEdit('{:U('cancelOrderMonery', array('idsaw' => $order[$orderModel::$id_d]))}', '退款申请中。。。。', 800, 600)"
													type="button" id="confirm">退款</button>

												</case> </switch>
											</div>
										</td>
									</div>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>
</section>
<script src="__COMMON__/js/alert.js"></script> <script
	src="__JS__/sendGoods.js?a={:time()}"></script> 
<script>
var Monery = {$price};
var MONERY_LIST = "{:U('couponInformation')}";
var ORDER_ID	= {$order[$orderModel::$id_d]};
</script>
</block>